public class text6 {
    public static int func(int n) {
        if(n == 1) {
            return 1;
        }
        return n * func(n - 1);
    }

    public static int Sum(int n) {
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += func(i);
        }
        return sum;
    }

    public static void main(String[] args) {
        System.out.println(Sum(5));
    }
}
